<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->comment('seo 标题');
            $table->string('keywords')->comment('seo 关键词');
            $table->string('description')->comment('描述');
            $table->string('product_name')->comment('产品名称');
            $table->longText('product_content')->comment('产品内容');
            $table->string('url')->comment('产品url')->unique();
            $table->text('product_banner')->comment('产品大图');
            $table->string('product_img')->comment('产品缩略图');
            $table->string('product_abstract')->comment('产品描述');
            $table->integer('category_id')->comment('产品分类id')->default(1);
            $table->integer('order')->comment('排序')->default(1);
            $table->string('is_show')->comment('是否展示')->default(0);
            $table->string('is_recommend')->comment('推荐显示')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
